#ifndef COLOR_H
#define COLOR_H


class CColor
{
    public:
        CColor( void );
        CColor( unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha );
        CColor( const CColor& color );
        //CColor operator=( const CColor& color );
        ~CColor( void );

        void Clear( void );
        void Set( unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha );
        void Set( const CColor& color );

        CColor& operator=( const CColor& color );

        //
        //  ACCESSORS AND MUTATORS
        //
        unsigned char GetRed( void ) const { return m_Red; }
        unsigned char GetGreen( void ) const { return m_Green; }
        unsigned char GetBlue( void ) const { return m_Blue; }
        unsigned char GetAlpha( void ) const { return m_Alpha; }
    private:
        unsigned char m_Blue;
        unsigned char m_Green;
        unsigned char m_Red;
        unsigned char m_Alpha;
};

inline void CColor::Clear( void )
{
    m_Blue = m_Green = m_Red = m_Alpha = 0;
}

inline CColor& CColor::operator=( const CColor& color )
{
    // check for self assignment
    if( this != &color )
    {
        m_Red   = color.GetRed();
        m_Green = color.GetGreen();
        m_Blue  = color.GetBlue();
        m_Alpha = color.GetAlpha();
    }

    return *this;
}

inline void CColor::Set( const CColor& color )
{
    *this = color;
}

inline void CColor::Set( unsigned char red, unsigned char green, unsigned char blue,
                         unsigned char alpha )
{
    Set( CColor( red, green, blue, alpha ) );
}

#endif // COLOR_H
